﻿@{
    ViewBag.Title = "Batch";
    Layout = "~/Views/Shared/Houyun.cshtml";
}

<div class="page-header clearfix">
    <h1 class="pull-left">全站站内通知</h1>
    <div class="pull-right">

        <a class="btn btn-success btn-sm" href="/Group/batchCreate">创建站内通知</a>


    </div>
</div>







<table id="batchnotification-table" class="table table-striped">
    <thead>
        <tr>
            <th width="30%">站内信通知标题</th>
            <th>发布时间</th>
            <th>创建时间</th>
            <th>发布人</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in ViewBag.message as List<LeEdu.MODEL.Message>)
        {

            <tr>
                <td><a href="/Group/batchSend/@item.MessageID" data-target="#Showmess@(item.MessageID)" data-toggle="modal">@item.MNAME</a>
                    <div class="modal fade" id="Showmess@(item.MessageID)" tabindex="-1" role="dialog"
                         aria-labelledby="myModalLabel" aria-hidden="true">
                        <div class="modal-dialog">
                            <div class="modal-content">
                            </div><!-- /.modal-content -->
                        </div>
                    </div>
                
                </td>
                @if (@item.MRELEASETIME == null)
                {
                    <td>--</td>
                }
                else
                {
                    <td>@item.MRELEASETIME</td>
                }

                <td>@item.MESTARTTIME</td>
                <td>@item.Users.Uname</td>
                <td>@(@item.MSTATE == 0 ? "已发布" : "未发布")</td>
                <td>
                    @if (@item.MSTATE == 0)
                    {
                        <div class="btn-group">

                            <a href="/Group/batchDel/@item.MessageID" class="btn btn-default btn-sm" onclick="return confirm('真的要删除该内容吗?')" data-role="delete-item">删除</a>
                        </div>
                    }
                    else
                    {

                        <div class="btn-group">

                            <a href="/Group/batchEdit/@item.MessageID" class="btn btn-default btn-sm">编辑</a>
                            <a href="#" type="button" class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown">
                                <span class="caret"></span>
                            </a>
                            <ul class="dropdown-menu">

                                <li><a href="/Group/batchGetid/@item.MessageID" data-role="publish-item" onclick="return confirm('发送后不可修改，确认发送?')">发布</a></li>
                                <li><a href="/Group/batchDel/@item.MessageID" onclick="return confirm('真的要删除该内容吗?')" data-role="delete-item">删除</a></li>

                            </ul>
                        </div>
                    }

                </td>
            </tr>
        }

    </tbody>
</table>
